﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TreeSharp;

namespace FelMaster.Classes.Paladin
{
    class FastRetribution : TalentBase
    {
        public override string Name
        {
            get { return "FastRet 0.4"; }
        }

        public override string KeySpell
        {
            get { return "Templar's Verdict"; }
        }

        public override Composite SingleRotation
        {
            get
            {
                return new PrioritySelector(
                    new Decorator(x => SC.PlayerIsChanneling, new TreeSharp.Action(a => SC.Log("Channeling"))),
                    SC.UseEngineerGloves(a => true, "Engineer's glove enchant"),
                    SC.CastSpell("Judgement", a => !SC.PlayerHasBuff("Judgements of the Pure"), "Judgement"),
                    SC.CastSpell("Zealotry", a => true, "Zealotry"),
                    SC.CastSpell("Guardian of Ancient Kings", a => SC.PlayerBuffTimeLeft("Zealotry") > 31 || SC.SpellCooldown("Zealotry") > 60, "Guardian of Ancient Kings"),
                    SC.CastSpell("Avenging Wrath", a => SC.PlayerBuffTimeLeft("Zealotry") > 21, "Avenging Wrath"),
                    SC.CastSpell("Inquisition", a => SC.PlayerBuffTimeLeft("Inquisition") <= 5 && (Me.CurrentHolyPower >= 3 || SC.PlayerHasBuff("Divine Purpose")), "Inquisition"),
                    SC.CastAreaSpell("Divine Storm", 8, false, 4, 0.0, 0.0, ret => Me.CurrentHolyPower < 3, "Divine Storm"),
                    SC.CastSpell("Crusader Strike", a => Me.CurrentHolyPower < 3, "Crusader Strike"),
                    SC.CastSpell("Hammer of Wrath", a => true, "Hammer of Wrath"),
                    SC.CastSpell("Exorcism", a => SC.PlayerHasBuff("The Art of War"), "Exorcism"),
                    SC.CastSpell("Templar's Verdict", a => Me.CurrentHolyPower >= 3 || SC.PlayerHasBuff("Divine Purpose"), "Templar's Verdict"),
                    SC.CastSpell("Judgement", a => true, "Judgement"),
                    SC.CastAreaSpell("Consecration", 8, false, 3, 0.0, 0.0, ret => Me.CurrentMana > 17000, "Consecration"),
                    SC.CastSpell("Holy Wrath", a => true, "Holy Wrath"),
                    SC.CastSpell("Consecration", a => Me.CurrentMana > 17000, "Consecration"),
                    SC.CastSpell("Divine Plea", a => true, "Divine Plea")
                );
            }
        }

        public override Composite Buffs
        {
            get
            {
                return new PrioritySelector(
                    SC.CastBuff("Seal of Truth", a => true, "Seal of Truth")
                );
            }
        }

        public override Composite PVPRotation
        {
            get { throw new NotImplementedException(); } //leave it as it is, unless you want to code a PVP specific rotation
        }

        public override Composite PVERotation
        {
            get
            {
                return SingleRotation;
            }
        }
    }
}